package com.ruoyi.postComplain.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.postComplain.mapper.PostComplainMapper;
import com.ruoyi.postComplain.domain.PostComplain;
import com.ruoyi.postComplain.service.IPostComplainService;
import com.ruoyi.common.core.text.Convert;

/**
 * 帖子举报 服务层实现
 * 
 * @author ruoyi
 * @date 2019-10-14
 */
@Service
public class PostComplainServiceImpl implements IPostComplainService 
{
	@Autowired
	private PostComplainMapper postComplainMapper;

	/**
     * 查询帖子举报信息
     * 
     * @param id 帖子举报ID
     * @return 帖子举报信息
     */
    @Override
	public PostComplain selectPostComplainById(Integer id)
	{
	    return postComplainMapper.selectPostComplainById(id);
	}
	
	/**
     * 查询帖子举报列表
     * 
     * @param postComplain 帖子举报信息
     * @return 帖子举报集合
     */
	@Override
	public List<PostComplain> selectPostComplainList(PostComplain postComplain)
	{
	    return postComplainMapper.selectPostComplainList(postComplain);
	}
	
    /**
     * 新增帖子举报
     * 
     * @param postComplain 帖子举报信息
     * @return 结果
     */
	@Override
	public int insertPostComplain(PostComplain postComplain)
	{
	    return postComplainMapper.insertPostComplain(postComplain);
	}
	
	/**
     * 修改帖子举报
     * 
     * @param postComplain 帖子举报信息
     * @return 结果
     */
	@Override
	public int updatePostComplain(PostComplain postComplain)
	{
	    return postComplainMapper.updatePostComplain(postComplain);
	}

	/**
     * 删除帖子举报对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deletePostComplainByIds(String ids)
	{
		return postComplainMapper.deletePostComplainByIds(Convert.toStrArray(ids));
	}


	public int updateComplainVerify(Integer complainVerify, Integer postId) {
		return postComplainMapper.updateComplainVerify(complainVerify,postId);
	}
	
}
